layui.use(['element', 'carousel'], function () {
    var element = layui.element;
    var carousel = layui.carousel;
    //建造实例
    carousel.render({
        elem: '#header-carousel'
        , width: '100%' //设置容器宽度
        , arrow: 'always' //始终显示箭头
    });
});